package com.lantosec.hmrp.modules.warning.controller;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.lantosec.hmrp.core.kit.PageVO;
import com.lantosec.hmrp.core.kit.Result;
import com.lantosec.hmrp.core.mvc.BaseController;
import com.lantosec.hmrp.modules.warning.entity.WarningLog;
import com.lantosec.hmrp.modules.warning.service.IWarningLogService;
import com.lantosec.hmrp.modules.warning.vo.WarningLogVO;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 *
 *  控制器
 *
 * @author AutoCode
 * @since 2020-06-09
 */
@Api(value = "预警日志控制器", tags = "预警日志控制器")
@RestController
@RequestMapping("/warning/log")
@Log4j2
public class WarningLogController extends BaseController {
    @Autowired
    private IWarningLogService service;

    @GetMapping("page")
    @ApiOperation(value = "分页查询")
    public Result<Page<WarningLogVO>> page(@ApiParam(value = "分页对象", required = true) PageVO<WarningLog> page, WarningLogVO condition){
        Page<WarningLog> logPage = service.queryPage(page, condition);
        return Result.ok(entity2VO(logPage));
    }
}
